package com.wjx.dingcan.web;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.kzw.core.orm.Page;
import com.kzw.core.orm.PageRequest;
import com.kzw.core.orm.StringPropertyFilter;
import com.kzw.core.util.ContextUtil;
import com.kzw.core.util.ExtjsUtil;
import com.kzw.core.web.action.BaseAction;
import com.kzw.oa.model.system.AppUser;
import com.kzw.oa.util.JSON;
import com.wjx.dingcan.model.Food;
import com.wjx.dingcan.service.FoodService;
/**
 * deal redirection.
 * */
@Controller
@Scope("prototype")
public class AppAction extends BaseAction {
	
	public String userCenter() {
		
		AppUser user = ContextUtil.getCurrentUser();
		try {
			if(user.getRoleType() == 1) {
				getResponse().sendRedirect("/dingcan/index.jsp");
			} else if(user.getRoleType() == 9){
				getResponse().sendRedirect("/dingcan/htmls/merchant_user_center.html");
			} else {
				getResponse().sendRedirect("/dingcan/htmls/user_center.html");
			}
		} catch(Exception e) {
			e.printStackTrace();
		}
		
		return SUCCESS;
	}


}
